package com.baitiaojun.elasticsearch.api;

import com.baitiaojun.api.util.ConstantUtil;
import com.baitiaojun.api.vo.JsonRes;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.io.IOException;

/**
 * @类名 FullTextSearchApi
 * @描述 TODO
 * @作者 白条君
 * @创建日期 2023/1/5 13:23
 * @版本 1.0
 */
@Api("全文检索接口")
@RequestMapping("/elasticsearch")
public interface FullTextSearchApi {

    @ApiOperation("全文检索")
    @GetMapping("/search")
    JsonRes fullTextSearch(@ApiParam(value = "关键词", required = true) @RequestParam String keyword, 
                           @ApiParam(value = "页码", example = "1") @RequestParam(defaultValue = ConstantUtil.FULL_TEXT_SEARCH_PAGE_NO) Integer pageNo,
                           @ApiParam(value = "总页数", example = "20") @RequestParam(defaultValue = ConstantUtil.FULL_TEXT_SEARCH_PAGE_SIZE) Integer pageSize) throws IOException, InterruptedException;
}
